﻿Imports lbGlobalcom
Public Class fListaMediosPago
    Dim daMP As dsBancosTableAdapters.GLO_MEDIOSPAGOTableAdapter
    Private lIdMedioP As String
    Public ReadOnly Property IdMedioPag() As String
        Get
            Return lIdMedioP
        End Get
    End Property

    Private Sub fListaMediosPago_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            daMP = New dsBancosTableAdapters.GLO_MEDIOSPAGOTableAdapter
            daMP.FillByOrdenDescrip(DsBancos.GLO_MEDIOSPAGO)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    Private Sub GetMedioPago()
        If lstMediosPago.SelectedValue IsNot Nothing Then
            lIdMedioP = lstMediosPago.SelectedValue
            Me.DialogResult = Windows.Forms.DialogResult.OK
        End If

    End Sub

    Private Sub lstMediosPago_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lstMediosPago.KeyDown
        If e.KeyCode = Keys.Enter Then
            GetMedioPago()
        End If
    End Sub
    Private Sub lstMediosPago_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstMediosPago.MouseDoubleClick
        GetMedioPago()
    End Sub
End Class